package com.wigem.fa.entity;

import lombok.Data;

@Data
public class ResultTable {
    private Integer code;
    private String msg;
    private Long count;
    private Object totalRow;
    private Object data;

    public ResultTable() {
    }

    public static ResultTable pageTable(long count, Object data) {
        ResultTable resultTable = new ResultTable();
        resultTable.setData(data);
        resultTable.setCode(0);
        resultTable.setCount(count);
        return resultTable;
    }

    public static ResultTable pageTable(Object data, long count, Object totalRow) {
        ResultTable resultTable = new ResultTable();
        resultTable.setData(data);
        resultTable.setCode(0);
        resultTable.setCount(count);
        resultTable.setTotalRow(totalRow);
        return resultTable;
    }

    public static ResultTable dataTable(Object data) {
        ResultTable resultTable = new ResultTable();
        resultTable.setData(data);
        resultTable.setCode(0);
        return resultTable;
    }
}
